<?php

define( 'INITTIME', microtime(1) );

require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it or make something more sophisticated.
if ( !in_array( md5( @$_SERVER['REMOTE_ADDR'] ),  PrivateConfiguration::$allowedIPs ) )
{
  header( 'Location: ' . str_replace( '/frontend_dev.php', '', "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] ) );
  die('You are not allowed to access this file. Replace "frontend_dev.php" in the URL with "index.php".');
}

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
sfContext::createInstance($configuration)->dispatch();
